#!/usr/bin/env node
/*
 * @Date: 2021-12-06 10:28:57
 * @Version: 1.0.0
 * @Author: chenhengling
 * @Description: create命令
 * @FilePath: \template-cli\src\cmds\create.js
 * @LastEditTime: 2021-12-06 15:21:17
 * @LastEditors: chenhengling
 */
const { program } = require('commander');

program
  .usage('<app-name> [options]')
  .argument('<app-name>')
  .description('create a new project powered by tp-cli')
  .option('-d, --default', 'Skip prompts and use default preset')
  .option('-m, --packageManager <command>', 'Use specified npm client when installing dependencies')
  .option('-r, --registry <url>', 'Use specified npm registry when installing dependencies')
  .option('-g, --git [message|false]', 'Force / skip git initialization, optionally specify initial commit message')
  .option('-n, --no-git', 'Skip git initialization')
  .option('-f, --force', 'Overwrite target directory if it exists')
  .option('--merge', 'Merge target directory if it exists')
  .option('-c, --clone', 'Use git clone when fetching remote preset')
  .option('-x, --proxy', 'Use specified proxy when creating project')
  .helpOption('-h, --help', 'Output usage information')
  .action((appName, opts) => {
    console.log(appName, opts);
  });

// if (!process.argv.slice(2).length) {
//   program.outputHelp();
//   console.log();
// }

program.parse(process.argv);
